package cn.iocoder.yudao.module.ai.dal.mysql.operationendcompany;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.operationendcompany.OperationEndCompanyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.operationendcompany.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 运营中心-公司管理（煤矿管理） Mapper
 *
 * @author 侯俊青
 */
@Mapper
public interface OperationEndCompanyMapper extends BaseMapperX<OperationEndCompanyDO> {

    default PageResult<OperationEndCompanyDO> selectPage(OperationEndCompanyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OperationEndCompanyDO>()
                .likeIfPresent(OperationEndCompanyDO::getName, reqVO.getName())
                .eqIfPresent(OperationEndCompanyDO::getDescription, reqVO.getDescription())
                .eqIfPresent(OperationEndCompanyDO::getCompanyId, reqVO.getCompanyId())
                .betweenIfPresent(OperationEndCompanyDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OperationEndCompanyDO::getSuplierId, reqVO.getSuplierId())
                .eqIfPresent(OperationEndCompanyDO::getLevel, reqVO.getLevel())
                .eqIfPresent(OperationEndCompanyDO::getBelongLevel1Id, reqVO.getBelongLevel1Id())
                .eqIfPresent(OperationEndCompanyDO::getBelongLevel2Id, reqVO.getBelongLevel2Id())
                .eqIfPresent(OperationEndCompanyDO::getRelationOrgId, reqVO.getRelationOrgId())
                .orderByDesc(OperationEndCompanyDO::getId));
    }

    List<String> getSelfAndSubCompanyIds(@Param("companyId") String companyId);
}